package com.companion.companion.service.impl;

import java.util.List;

import com.companion.companion.domain.Caregiver;
import com.companion.companion.mapper.CaregiverMapper;
import com.companion.companion.service.ICaregiverService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 护工信息Service业务层处理
 * 
 * @author zly
 * @date 2025-05-06
 */
@Service
public class CaregiverServiceImpl implements ICaregiverService
{
    @Autowired
    private CaregiverMapper caregiverMapper;

    /**
     * 查询护工信息
     * 
     * @param caregiverId 护工信息主键
     * @return 护工信息
     */
    @Override
    public Caregiver selectCaregiverByCaregiverId(Long caregiverId)
    {
        return caregiverMapper.selectCaregiverByCaregiverId(caregiverId);
    }

    /**
     * 查询护工信息列表
     * 
     * @param caregiver 护工信息
     * @return 护工信息
     */
    @Override
    public List<Caregiver> selectCaregiverList(Caregiver caregiver)
    {
        System.out.println("selectCaregiverList:");
        System.out.println(caregiverMapper.selectCaregiverList(caregiver));
        return caregiverMapper.selectCaregiverList(caregiver);
    }

    /**
     * 新增护工信息
     * 
     * @param caregiver 护工信息
     * @return 结果
     */
    @Override
    public int insertCaregiver(Caregiver caregiver)
    {
        return caregiverMapper.insertCaregiver(caregiver);
    }

    /**
     * 修改护工信息
     * 
     * @param caregiver 护工信息
     * @return 结果
     */
    @Override
    public int updateCaregiver(Caregiver caregiver)
    {
        return caregiverMapper.updateCaregiver(caregiver);
    }

    /**
     * 批量删除护工信息
     * 
     * @param caregiverIds 需要删除的护工信息主键
     * @return 结果
     */
    @Override
    public int deleteCaregiverByCaregiverIds(Long[] caregiverIds)
    {
        return caregiverMapper.deleteCaregiverByCaregiverIds(caregiverIds);
    }

    /**
     * 删除护工信息信息
     * 
     * @param caregiverId 护工信息主键
     * @return 结果
     */
    @Override
    public int deleteCaregiverByCaregiverId(Long caregiverId)
    {
        return caregiverMapper.deleteCaregiverByCaregiverId(caregiverId);
    }
}
